<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" %>
<html>
<%@include file="../common/include-header.jsp" %>

<body class="gray-bg">

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="role-form">
                <div class="select-list">
                    <ul>
                        <li>
                            班/校排行：
                            <select required name="rankingByClass" id="rankingByClass">
                                <option value="${sessionScope.user.classId}" selected>本班</option>
                                <option value="">本校</option>
                            </select>
                        </li>
                        <li>
                            <select required name="rankingByTime" id="rankingByTime">
                                <option value="thisWeek">本周</option>
                                <option value="thisMonth">本月</option>
                                <option value="preWeek">上周</option>
                                <option value="preMonth">上月</option>
                            </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true">

            </table>
        </div>
    </div>
</div>
<%@include file="../common/include-footer.jsp" %>
<script th:inline="javascript">
    var prefix = "/ranking";
    $(function () {
        var options = {
            url: prefix + "/list",
            sortName: "asc",
            height: 500,
            modalName: "考试",
            columns: [
                {
                    field: 'rankingId',
                    title: '序号'
                },
                {
                    field: 'stuName',
                    title: '学生姓名',
                },
                {
                    field: 'okAmount',
                    title: '答题数量',
                },
                {
                    field: 'correctAmount',
                    title: '正确题数',
                },
                {
                    field: 'amount',
                    title: '题目总数'
                },
                {
                    field: 'accuracy',
                    title: '正确率',
                }
                ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
